<?php

namespace app\controllers\api;

use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
/**
 * Default controller for the `admin` module
 */
class ApiBaseController extends Controller
{
    public $enableCsrfValidation = false;

    public function ajaxMessage($data = [], $message = 'success', $code = 0)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        return [
            'data'    => $data,
            'message' => $message,
            'code'    => $code,
        ];
    }
}
